﻿using System;
using System.Windows;
using System.Windows.Controls;

namespace FrontDisplay
{
    static class Global
    {
        internal static string ApplicationName = "FrontDisplay";
        internal static string ApplicationDataFolder = 
            Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + System.IO.Path.AltDirectorySeparatorChar +
            ApplicationName + System.IO.Path.AltDirectorySeparatorChar;

        //public static void MouseDown(double x, double y)
        //{
        //    if ((x < 0) || (x > 1) || (y < 0) || (y > 1)) return;

        //    int mouseX = (int)(Application.Current.MainWindow.ActualWidth * x);// + Application.Current.MainWindow.Left);
        //    int mouseY = (int)(Application.Current.MainWindow.ActualHeight * y);// + Application.Current.MainWindow.Top);

        //    //int lParam = (mouseY << 16) + mouseX;
        //    Logger.Info(string.Format("MouseDown {0}x{1}", mouseX, mouseY));

        //    //WinApi.Point clntClickLocation = WinApi.ScreenToClient(curr, scrClickLocation);
        //    IntPtr lParamClickLocation = WinApi.MakeLParam(mouseX, mouseY);

        //    //Send click messages 
        //    WindowInteropHelper hWnd = new WindowInteropHelper(Application.Current.MainWindow);
        //    WinApi.PostMessage(hWnd.Handle, WinApi.WM_LBUTTONDOWN, new IntPtr(WinApi.MK_LBUTTON), lParamClickLocation);
        //    //WinApi.PostMessage(hWnd.Handle, WinApi.WM_LBUTTONUP, new IntPtr(WinApi.MK_LBUTTON), lParamClickLocation);
        //}

        public static Canvas MainPanel
        {
            get
            {
                return ((MainWindow) Application.Current.MainWindow).MainPanel;
            }
        }

        private static Configuration _config = new Configuration();

        public static Configuration Config
        {
            get
            {
                return _config;
            }
        }

    }
}
